/*    */ package com.zimbra.cs.account;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SearchAccountsOptions
/*    */   extends SearchDirectoryOptions
/*    */ {
/* 31 */   private static final IncludeType DEFAULT_INCLUDE_TYPE = IncludeType.ACCOUNTS_AND_CALENDAR_RESOURCES;
/*    */   private IncludeType includeType;
/*    */   
/*    */   public static enum IncludeType {
/* 35 */     ACCOUNTS_AND_CALENDAR_RESOURCES, 
/* 36 */     ACCOUNTS_ONLY, 
/* 37 */     CALENDAR_RESOURCES_ONLY;
/*    */     
/*    */     private IncludeType() {}
/*    */   }
/*    */   
/*    */   public SearchAccountsOptions() {
/* 43 */     initIncludeType();
/*    */   }
/*    */   
/*    */   public SearchAccountsOptions(Domain domain) {
/* 47 */     initIncludeType();
/* 48 */     setDomain(domain);
/*    */   }
/*    */   
/*    */   public SearchAccountsOptions(String[] returnAttrs) {
/* 52 */     initIncludeType();
/* 53 */     setReturnAttrs(returnAttrs);
/*    */   }
/*    */   
/*    */   public SearchAccountsOptions(Domain domain, String[] returnAttrs) {
/* 57 */     initIncludeType();
/* 58 */     setDomain(domain);
/* 59 */     setReturnAttrs(returnAttrs);
/*    */   }
/*    */   
/*    */   private void initIncludeType() {
/* 63 */     setIncludeType(DEFAULT_INCLUDE_TYPE);
/*    */   }
/*    */   
/*    */   public void setIncludeType(IncludeType includeType) {
/* 67 */     assert (includeType != null);
/*    */     
/* 69 */     this.includeType = includeType;
/* 70 */     switch (this.includeType) {
/*    */     case ACCOUNTS_AND_CALENDAR_RESOURCES: 
/* 72 */       setTypesInternal(new SearchDirectoryOptions.ObjectType[] { SearchDirectoryOptions.ObjectType.accounts, SearchDirectoryOptions.ObjectType.resources });
/* 73 */       break;
/*    */     case ACCOUNTS_ONLY: 
/* 75 */       setTypesInternal(new SearchDirectoryOptions.ObjectType[] { SearchDirectoryOptions.ObjectType.accounts });
/* 76 */       break;
/*    */     case CALENDAR_RESOURCES_ONLY: 
/* 78 */       setTypesInternal(new SearchDirectoryOptions.ObjectType[] { SearchDirectoryOptions.ObjectType.resources });
/*    */     }
/*    */   }
/*    */   
/*    */   public IncludeType getIncludeType()
/*    */   {
/* 84 */     return this.includeType;
/*    */   }
/*    */   
/*    */   public void setTypes(String typesStr) throws ServiceException
/*    */   {
/* 89 */     throw ServiceException.FAILURE("internal error, use setIncludeType instead", null);
/*    */   }
/*    */   
/*    */   public void setTypes(SearchDirectoryOptions.ObjectType... objTypes) throws ServiceException
/*    */   {
/* 94 */     throw ServiceException.FAILURE("internal error, use setIncludeType instead", null);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/SearchAccountsOptions.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */